<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1, minimum-scale=1, user-scalable=no"
    />
    <title>提交订单</title>
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/dialog.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <script src="../js/flexible.js" type="text/javascript"></script>
    <script src="../js/swiper.min.js" type="text/javascript"></script>
    <script src="../js/zepto-v1.2.0.min.js" type="text/javascript"></script>
    <script src="../js/dialog.min.js" type="text/javascript"></script>
  </head>
  <body>
    <div class="submit-order-wrapper common-wrapper">
      <header class="header-wrapper clearfix">
        <div class="header-container white-background">
          <div class="left-container">
            <a class="back black-back" href="javascript:history.back(-1)"></a>
          </div>
          <span class="title">提交订单</span>
        </div>
      </header>
      <div class="order-container">
        <section class="address-wrapper">
          <div class="address-container">
            <div class="empty-address">请补充收货地址</div>
            <div class="address-info">
              <div class="address">
                杭州市滨江区黄河街道长江小区34号楼5单元1201室
              </div>
              <div class="user-info">
                <span class="name">黄晓明</span>
                <span class="tel">18823217876</span>
              </div>
            </div>
          </div>
          <span class="right-arrow"></span>
        </section>
        <section class="goods-list3">
          <div class="goods-item">
            <img src="../img/1x/goods-plane3.png" />
            <div class="goods-info">
              <div class="goods-name">
                商品名称商品名称商品名称商品名称 商品名称商品名称
              </div>
              <div class="goods-desc">DA-40型号</div>
            </div>
            <div class="order-info">
              <div class="price">￥320.00</div>
              <div class="count">X2</div>
            </div>
          </div>
          <div class="goods-item">
            <img src="../img/1x/goods-plane3.png" />
            <div class="goods-info">
              <div class="goods-name">
                商品名称商品名称商品名称商品名称 商品名称商品名称
              </div>
              <div class="goods-desc">DA-40型号</div>
            </div>
            <div class="order-info">
              <div class="price">￥320.00</div>
              <div class="count">X2</div>
            </div>
          </div>
          <div class="goods-item">
            <img src="../img/1x/goods-plane3.png" />
            <div class="goods-info">
              <div class="goods-name">
                商品名称商品名称商品名称商品名称 商品名称商品名称
              </div>
              <div class="goods-desc">DA-40型号</div>
            </div>
            <div class="order-info">
              <div class="price">￥320.00</div>
              <div class="count">X2</div>
            </div>
          </div>
          <div class="goods-item">
            <img src="../img/1x/goods-plane3.png" />
            <div class="goods-info">
              <div class="goods-name">
                商品名称商品名称商品名称商品名称 商品名称商品名称
              </div>
              <div class="goods-desc">DA-40型号</div>
            </div>
            <div class="order-info">
              <div class="price">￥320.00</div>
              <div class="count">X2</div>
            </div>
          </div>
          <div class="goods-item">
            <img src="../img/1x/goods-plane3.png" />
            <div class="goods-info">
              <div class="goods-name">
                商品名称商品名称商品名称商品名称 商品名称商品名称
              </div>
              <div class="goods-desc">DA-40型号</div>
            </div>
            <div class="order-info">
              <div class="price">￥320.00</div>
              <div class="count">X2</div>
            </div>
          </div>
          <div class="delivery info-item">
            <label>配送方式</label>
            <span class="info">
              <span>快递￥18.00</span>
              <span class="right-arrow"></span>
            </span>
          </div>
          <div class="remark info-item">
            <label>订单备注</label>
            <textarea placeholder="请输入订单备注内容"></textarea>
          </div>
        </section>
        <footer class="submit-bar">
          <div class="order-info">
            <span class="desc">
              共<span class="count">10</span>件&nbsp; 含运费：¥<span class="delivery">18</span>&nbsp;
            </span>
            <span class="summary">
              合计：<span class="total">¥<span class="amount">3218.50</span></span>
            </span>
          </div>
          <a class="normal-btn primary-btn submit-order">提交订单</a>
        </footer>
      </div>
    </div>
  </body>
  <script src="../js/footerNav.js"></script>
  <script>
    $(document).ready(function () {
      const url_string = window.location.href
      const url = new URL(url_string)
      const hasAddress = url.searchParams.get('hasAddress')
      if (hasAddress === 'true') {
        $('.address-info').show()
        $('.empty-address').hide()
      } else {
        $('.address-info').hide()
        $('.empty-address').show()
      }
      $('.address-wrapper').click(function() {
        if (hasAddress === 'true') {
          window.location.href = '../page/addressList.html?hasAddress=true';
        } else {
          window.location.href = '../page/addressList.html';
        }
      })
      $('.submit-order').click(function() {
        const summary = $('.summary .amount').html()
        window.location.href = `cashier.html?summary=${summary}`
      })
    })
  </script>
</html>
